﻿var formatText = function (elCell, oRecord, oColumn, sData) {

    if (sData == "F") {
        elCell.innerHTML = "女";
    } else if (sData == "M") {
        elCell.innerHTML = "男";
    }
    else {
        elCell.innerHTML = sData;
    }
}
//专员新增
var fnCustomAdd = function () {
    parent.addTabs('新增联系人信息', '../Crm/Customer/EditCrmLinkMan.aspx');
    parent.NeedRefreshPage = this;
}

//专员编辑
var fnCustomEdit = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    var id = record.getData("ID");
    var cid = record.getData("CustomId");
    parent.addTabs('编辑联系人信息', '../Crm/Customer/EditCrmLinkMan.aspx?r=' + Math.random() + '&entity=CrmLinkMan&cid=' + cid + '&id=' + id);
    parent.NeedRefreshPage = this;

}

//双击事件
function CustomDbClick() {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }                         
    var id = record.getData("ID");
    var cid=record.getData("CustomId");
    parent.addTabs('编辑联系人信息', '../Crm/Customer/EditCrmLinkMan.aspx?r=' + Math.random() + '&entity=CrmLinkMan&cid=' + cid + '&id=' + id);
    parent.NeedRefreshPage = this;
}

if (typeof ($) == "undefined") { //屏蔽右键
    parent.unContextMenu(document);
    /*$(document).ready(function () { 
    if (typeof (parent.unContextMenu) == "function") {
    parent.unContextMenu(document);
    }
    if (typeof (parent.parent.unContextMenu) == "function") {
    parent.parent.unContextMenu(document);
    }
    });*/
}
if (typeof (YAHOO) == "undefined") {
    parent.unContextMenu(document);
}